
<br/>
	<table align="right">
    	<tr><td>
	<?php
    	if(isset($_SESSION["memname"])){
			?>
            	Welcome <font style="font-style:italic;"><?php echo $_SESSION["memname"]; ?></font>
				<a href="logout.php" style="text-decoration:none;">logout</a>
			<?
		}
		else{
	?>
    <fieldset>
        <legend>Login</legend>
        <form name="loginForm" id="loginForm" method="post" action="logincheck.php">
        	<table width="100px" align="right">
            	<tr>
                	<td><input type="text" id="username" name="username" onBlur="javascript:loginHint();" onFocus="javascript:usernameClick();" /></td>
                </tr>
                <tr>
                	<td><input type="password" id="pwd" name="pwd" onBlur="javascript:loginHint();" onFocus="javascript:pwdClick();" /></td>
                </tr>
                <tr>
                	<td align="center">
                    	<input type="submit" value="login" style="background:none">
                    	<a href="register.php" style="color:#0033FF; text-decoration:none;">register</a>
                    </td>
                </tr>
            </table>
        </form>
    </fieldset>
    
    <?php
		}
	?>
       
 		</td></tr> 
    </table>
 
 <script language="javascript">
 	function loginHint(){
		if(document.getElementById("username").value.length == 0){
			document.getElementById("username").style.color = "#CCCCCC";
			document.getElementById("username").value = "Username";
		}
		if(document.getElementById("pwd").value.length == 0){
			document.getElementById("pwd").style.color = "#CCCCCC";
			document.getElementById("pwd").value = "password";
		}
	}
	function usernameClick(){
		document.getElementById("username").value = "";
		document.getElementById("username").style.color = "#000000";
	}
	function pwdClick(){
		document.getElementById("pwd").value = "";
		document.getElementById("pwd").style.color = "#000000";
	}
	window.onload = loginHint;
 </script>